﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Logistics_management
{
    public partial class Login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {

            }
        }

        protected void btnLogin_Click(object sender, EventArgs e)
        {
            string name = txtName.Text;
            string password = txtPassword.Text;
           
            if (BLL.UserinfoBLL.GetUserinfo(name, password)!=null)
            {
                Session["name"] = BLL.UserinfoBLL.GetUserinfo(name, password).UserName;
                Session["Sex"] = BLL.UserinfoBLL.GetUserinfo(name, password).Sex;
                Session["Sex"] = BLL.UserinfoBLL.GetUserinfo(name, password).Sex;
                Session["Phone"] = BLL.UserinfoBLL.GetUserinfo(name, password).Phone;
                Session["E-mail"] = BLL.UserinfoBLL.GetUserinfo(name, password).Email;
                Session["account"] = BLL.UserinfoBLL.GetUserinfo(name, password).UserName;
                Response.Redirect("Index.aspx");
            }
            else
            {
                lbl.Text = "用户名或密码错误";
            }
        }
    }
}